<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>街道页</title>
    <%@include file="../util/common.jsp"%>

</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <form class="form-horizontal" action="${pageContext.request.contextPath}/rent/street" method="post">
                    <input type="hidden" name="action" value="${action}">
                    <input type="hidden" name="id" value="${street.id}">
                    <div class="form-group">
                        <label for="streetName" class="col-sm-2 control-label">街道名</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="streetName" name="streetName" value="${street.name}" placeholder="请输入街道名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="districtId" class="col-sm-2 control-label">区县</label>
                        <div class="col-sm-8">
                            <select id="districtId" name="districtId" class="form-control">
                                <option value="-1">全部区县</option>
                                <!-- 从Servlet中获取区县集合，进行遍历 -->
                                <c:forEach var="dis" items="${districts}">
                                    <option value="${dis.id}" <c:if test="${dis.id eq street.districtId}">selected</c:if>>${dis.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-default">${action eq "add" ? "新增":"修改"}街道</button>
                            <button type="reset" class="btn btn-default">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

    </div>
</body>
</html>
